import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    //  主页:
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/HomeView.vue'),
    },
    // 搜索页
    {
      path: '/details',
      name: 'details',
      component: () => import('@/views/DetailsView.vue'),
    },
    // 默认路由
    { 
      path: '/:pathMatch(.*)*',
       name: 'NotFound', 
       component: 'NotFound' },
  ],
})

export default router
